// 主动触发窗口变化事件，让图表根据窗口变化而自适应
const changeWindowSize = () => {
    if (document.createEvent) {
        const event = document.createEvent('HTMLEvents')
        event.initEvent('resize', true, true)
        window.dispatchEvent(event)
    } else if (document.createEventObject) {
        window.fireEvent('onresize')
    }
}
// 阻止冒泡和默认行为
const stopBubbleDefault = e => {
    e.stopPropagation ? e.stopPropagation() : window.event.cancelBubble = true
    e.preventDefault ? e.preventDefault() : e.returnValue = false
}
export default { changeWindowSize, stopBubbleDefault }
